<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link th:href="@{../css/shop.css}" type="text/css" rel="stylesheet" />
<link th:href="@{../css/bkg_ui.css}" type="text/css"  rel="stylesheet" />
<link th:href="@{../layui/css/layui.css}" type="text/css" rel="stylesheet" />

<title>添加优惠券</title>
</head>
<body>
<div class="margin" id="page_style">

  <div class="add_style">
      <form id="addCoupon" action="/CouponController/addCoupon">
          <ul>
              <li class="clearfix">
                  <label class="label_name col-xs-2"><i>*</i>优惠券名称：&nbsp;&nbsp;</label>
                  <div class="col-xs-10">
                      <input name="couponname" type="text"  class="col-xs-3"/>
                  </div>
              </li>
              <li class="clearfix">
                  <label class="label_name col-xs-2"><i>*</i>优惠券类型：&nbsp;&nbsp;</label>
                  <div class="col-xs-2">
                      <select class="col-xs-12" name="coupontype" id="selectt">
                          <option value="">请选择</option>
                          <option value="0">无门槛</option>
                          <option value="1">类别</option>
                          <option value="2">商品</option>
                      </select>
                  </div>
                  <label class="label_name col-xs-1"><i>*</i>优惠券面值：&nbsp;&nbsp;</label>
                  <div class="col-xs-4">
                      <input type="text" name="couponvalue" class="col-xs-4"/>
                  </div>
              </li>
              <li class="clearfix">
                  <label class="label_name col-xs-2"><i>*</i>优惠券库存：&nbsp;&nbsp;</label>
                  <div class="col-xs-1">
                      <input name="couponrepertory" type="text"  class="col-xs-12"/>
                  </div>

                  <div id="dis">

                      <label class="label_name col-xs-1" id="tyty" style="display: none"><i>*</i>关联类别：&nbsp;&nbsp;</label>
                      <div class="col-xs-4" >
                          <select  class="col-xs-4" name="releid" id="showtype" style="display: none">
                              <option value="">请选择类型</option>
                              <option th:each="e:${showtypelist}"  th:value="${e.getShowTypeId()}" th:text="${e.getTypeName()}"></option>
                          </select>
                          <select class="col-xs-4" name="iddd" id="commdity" style="display: none">
                              <option value="">请选择商品</option>
                              <option th:each="c:${commditylist}"  th:value="${c.getCommodityId()}" th:text="${c.getCommodityName()}"></option>
                          </select>
                      </div>
                  </div>



              </li>
              <li class="clearfix layui-form">
                  <label class="label_name col-xs-2"><i>*</i>天数：&nbsp;&nbsp;</label>
                  <div class="col-xs-2">
                      <input type="text" class="layui-input" placeholder="天数" name="numberdays">
                  </div>
              </li>
              <li class="clearfix layui-form">
                  <label class="label_name col-xs-2"><i>*</i>开始时间：&nbsp;&nbsp;</label>
                  <div class="col-xs-2">
                      <input type="text" class="layui-input" id="test1" placeholder="开始日" name="starttime">
                  </div>
              </li>
              <li class="clearfix">
                  <label class="label_name col-xs-2"><i>*</i>结束时间：&nbsp;&nbsp;</label>
                  <div class="col-xs-2">
                      <input type="text" class="layui-input col-xs-2" id="test2" placeholder="结束日" name="endtime">
                  </div>
              </li>
              <li class="clearfix">
                  <div class="col-xs-10 layui-col-md-offset4">
                      <input class="btn button_btn bg-deep-blue" type="button" id="add" value="保存提交"/>
                      <a href="getAll"><input class="btn button_btn bg-gray" type="button" value="取消添加"/></a>
                  </div>
              </li>
          </ul>
      </form>
  </div>
</div>
<script th:src="@{../layui/layui.js}"></script>
<script type="text/javascript" th:src="@{../js/jquery-1.9.1.min.js}"></script>
<script type="text/javascript" src="../js/addCoupon.js"></script>
<script>
    layui.use('laydate', function(){
        var laydate = layui.laydate

        //执行一个laydate实例
        laydate.render({
            elem: '#test1',
            type:'datetime'
        });
        laydate.render({
            elem: '#test2',
            type:'datetime'
        });
    });
</script>
</body>
</html>